package cn.wit.summit.chwan.ui.activity;

import android.os.Bundle;
import android.support.v4.view.ViewPager;

import com.flyco.tablayout.SlidingTabLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.wit.summit.chwan.R;
import cn.wit.summit.chwan.adapters.FragmentPagerAdapter;
import cn.wit.summit.chwan.ui.base.MyActivity;
import cn.wit.summit.chwan.ui.fragment.DownlodingGamesFragment;

/**
 * Created by pengsk on 2018/4/19.
 */

public class DownloadCenterActivity extends MyActivity {

    @Bind(R.id.tabs)
    SlidingTabLayout tabs;
    @Bind(R.id.viewPager)
    ViewPager viewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_download_center);
        ButterKnife.bind(this);
        setBarTitleTx("下载管理");
        List<FragmentPagerAdapter.Item> items = new ArrayList<>();
        items.add(new FragmentPagerAdapter.Item("下载中", DownlodingGamesFragment.newInstance(1)));
        items.add(new FragmentPagerAdapter.Item("已下载", DownlodingGamesFragment.newInstance(2)));
        FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager(), items);
        viewPager.setAdapter(adapter);
        tabs.setViewPager(viewPager);
//        tabs.post(new Runnable() {
//            @Override
//            public void run() {
//                setIndicator(tabs, 40, 40);
//            }
//        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
